<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<link href="assets/css/bootstrap-select.css" rel="stylesheet" />
<link href="assets/css/front/listCommonStyle.css" rel="stylesheet"/>
<link href="assets/css/modify.css" rel="stylesheet"/>
<script src="assets/js/select2/select2.js"></script>
<style>
    .iconchange1 .fa{
        color: #2a6496;
        font-size: 12px!important;
    }
    .businessBtns .btn {
         margin-right: 0px;
    }
</style>
<div class="row margin-left-10">
    <input type="hidden" id="type" value="${type}">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="widget flat margin-top-0" style="margin: -10px 0 0px 0!important;">
            <div class="widget-header bordered-sky theme-bordered nopadding">
                <div class="widget-buttons widget-label nomargin-bottom">
                    <label class="businessBtns">
                        <ol class="breadcrumb" style="margin: 0;">
                            <li style="color: #809fa6;">考勤管理</li>
                            <li class="active" style="color: #23a8f5;">班级考勤</li>
                        </ol>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="widget searchCriteria flat" style="margin: 3px 0 10px 0!important;">
            <div class="widget-header bordered-sky theme-bordered nopadding">
                <div class="widget-buttons widget-label nomargin-bottom">
                    <label class="businessBtns">
                        <@hp code="BJKQ8242730453562-list_class_qz"/><@hp code="BJKQ8242730453562-list_class_gd"/>
                        <!--<a type="btn" class="btn basicInfoBtnt parentChildBtn"
                           style="background-color: #23a8f5;border: none;border-top-left-radius: 4px!important;border-bottom-left-radius: 4px!important;width: 120px;color: #fff;margin-right: 0!important;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
                            亲子班级
                        </a>-->

                        <!--<a type="btn" class="btn basicInfoBtnt interimBtn"
                               style="border: none;border-top-right-radius: 4px!important;border-bottom-right-radius: 4px!important;width: 120px;color: #4a647d;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
                            过渡班级
                        </a>-->
                    </label>
                    <label class="pull-right businessBtns">
                        <label class="margin-right-20">
                            <@hp code="BJKQ8242730453562-list_exadata"/>
                            <!--<a style="border-radius: 0px;border: none;background: #23a8f5 !important;margin-right: 25px;"
                               class="btn btn-blue shiny download" onclick="exportData('${searchFormId}','MemberInformation.xlsx')"><i class="fa fa-download"></i>导出</a>-->
                            <a style="border-radius: 0px;border: none;background: #ffab00 !important;margin-right: 25px;"
                               class="btn btn-warning shiny search "><i class="fa fa-search"></i>搜索
                            </a>
                            <@hp code="BJKQ8242730453562-list_batch_kaoqin"/>
                            <!--<a style="border-radius: 0px;border: none;background: #ffab00 !important;"
                               class="btn btn-warning shiny" onclick="batchAttendance(this)"><i class="fa fa-dedent"></i>批量考勤
                            </a>-->
                        </label>
                        <label onclick="iconsChange()" >
                            <label>
                                <a class="iconsChangeA" style="width: 13px;height: 13px;cursor: pointer;background: url('assets/img/nav-img/icon_hidden.png');display: block;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none;user-select:none;" value="1"></a>
                            </label>
                            <label style="color: #23a8f5 ;vertical-align: middle;padding-top:4px;">
                                <span class="iconsChangeSpan" style="-webkit-user-select:none; cursor: pointer;-moz-user-select:none; -ms-user-select:none;user-select:none;">隐藏搜索栏</span>
                            </label>
                        </label>
                    </label>
                </div>
            </div>
        </div>
        <div class="search_Bar" style="vertical-align: middle">
            <form id="${searchFormId}" action="${actionUrl}" class="searchConditions" method="POST">
                <div class="row searchInput" style="margin: 0;">
                    <label class="iconchange1 hidden" style="position: absolute;right: 10px;top: 0px;" >
                        <a class="search_Bar_A" id="iconchangemore" style="color: #2a6496;cursor: pointer;" onclick="iconchangeShow(this)" value="1">筛选更多<i class="fa fa-chevron-down" style="padding-left: 5px"></i></a>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">授课老师：</label>
                        <label>
                            <select class="form-select-1" name="realName" id="adminUserId" value="${search_map.realName[0]}"
                                    style="width:200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" >
                            </select>
                            <!--<input type="text" name="type" class="realName" value="${search_map.realName[0]}" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">-->
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">课程体系：</label>
                        <label>
                            <select class="form-select-1" name="courseSystemName" id="courseSystemName" value="${search_map.courseSystemName[0]}"
                                    style="width:200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" >
                            </select>
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">上课教室：</label>
                        <label>
                            <select class="form-select-1" name="roomName" id="roomName" value="${search_map.roomName[0]}"
                                    style="width:200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" >
                            </select>
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">考勤状态：</label>
                        <label>
                            <select class="form-select-1" name="classAttendanceStatus" id="classAttendanceStatus" value="${search_map.classAttendanceStatus[0]}"
                                    style="width:200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" >
                                <option value="">请选择</option>
                                <option value="1">未考勤</option>
                                <option value="2">部分考勤</option>
                                <option value="3">已考勤</option>
                            </select>
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">日期范围：</label>
                        <label>
                            <input type="text" id="d4311" name="classTime_begin" class="beginValue Wdate" value="${search_map.classTime_begin[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;" onFocus="WdatePicker({doubleCalendar:false,maxDate:'#F{$dp.$D(\'d4312\')}',dateFmt:'yyyy-MM-dd'})"> 至
                            <input id="d4312"  type="text" name="classTime_end" class="endValue Wdate" value="${search_map.classTime_end[0]}" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;" onFocus="WdatePicker({doubleCalendar:false,minDate:'#F{$dp.$D(\'d4311\')}',dateFmt:'yyyy-MM-dd '})">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">上课时间：</label>
                        <label>
                            <input id="d4313" type="text" name="startTime_begin" class="beginValue Wdate" value="${search_map.startTime_begin[0]}"
                                   onFocus="WdatePicker({doubleCalendar:false,maxDate:'#F{$dp.$D(\'d4314\')}',dateFmt:'HH:mm:ss'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                            <input id="d4314"  type="text" name="endTime_end" class="endValue Wdate"  value="${search_map.endTime_end[0]}"
                                   onFocus="WdatePicker({doubleCalendar:false,minDate:'#F{$dp.$D(\'d4313\')}',dateFmt:'HH:mm:ss'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">课程名称：</label>
                        <label>
                            <select class="form-select-1 courseId" name="courseName"
                                    style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" >
                                <option value="">请先选择课程体系</option>
                            </select>
                            <!--<input type="text" name="type" class="courseName" value="${search_map.courseName[0]}" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">-->
                        </label>
                    </label>
                </div>
            </form>
        </div>
        <div class="widget flat radius-bordered" style="margin-top: 0px;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
            <div class="widget-body no-padding">
                <div class="topPagingBar hidden">
                    ${pagingBar}
                </div>
                <div class="table-scrollable" style="border: none;" id="tableScrollable">
                    <!-- 数据表列信息列表 -->
                    <table class="table table-hover dataTable newtable">
                        <thead>
                        <tr>
                            <th title="选择" class="checkboxColumnTh">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" class="chkAll">
                                        <span class="text"></span>
                                    </label>
                                </div>
                            </th>
                            <th title="属性名">序号</th>
                            <th title="操作项">操作项</th>
                            <th title="课程体系">课程体系</th>
                            <th title="课程名称">课程名称</th>
                            <th title="授课老师">授课老师</th>
                            <th title="课程日期">课程日期 </th>
                            <th title="上课时间">上课时间</th>
                            <th title="上课教室">上课教室</th>
                            <th title="人数">人数</th>
                            <th title="班级考勤状态">班级考勤状态</th>
                            <th title="最后操作日期">最后操作日期</th>
                            <th title="操作人">操作人</th>
                        </tr>
                        </thead>
                        <tbody id="tableScrollableClassAttendanceManagement">
                        <#if page_bean.list?size==0>
                            <tr>
                                <td align="center">无数据</td>
                            </tr>
                        </#if>
                        <#list page_bean.list as data>
                            <tr>
                                <td class="checkboxColumnTd">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="chk"  name="id" value="${data.id}" lessonsId >
                                            <span class="text"></span>
                                        </label>
                                    </div>
                                </td>
                                <td>${data_index+1+(page_bean.pageNo-1)*page_bean.pageSize}</td>
                                <td align="center">
                                    <!--<a href="javascript:void(0);" class="classAttendanceTd"
                                       lessonsId="${data.id}"
                                    >操作考勤</a>-->
                                    <@hp code="BJKQ8242730453562-list_attendance"  params="[lessonsId=${data.id}]" />
                                </td>
                                <td>${(data.courseSystemName???string(data.courseSystemName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.courseName???string(data.courseName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.realName???string(data.realName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.classTime???string(data.classTime?html,"未设置"))!'未设置'}</td>
                                <!--<td>Format(${data.createTime},"yyyy-MM-dd");</td>-->
                                <td>${(data.startTime???string(data.startTime?html,"未设置"))!'未设置'}
                                    <label>-</label>
                                    ${(data.endTime???string(data.endTime?html,"未设置"))!'未设置'}</td>
                                <td>${(data.roomName???string(data.roomName?html,"未设置"))!'未设置'}</td>
                                <td>${(data.sumPeople???string(data.sumPeople?html,"未设置"))!'未设置'}</td>
                                <td>${(data.classAttendanceStatus???string(data.classAttendanceStatus?html,"未设置"))!'未设置'}</td>
                                <td>${(data.updateTime???string(data.updateTime?html,"未设置"))!'未设置'}</td>
                                <td>${(data.userName???string(data.userName?html,"未设置"))!'未设置'}</td>
                            </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>
                ${pagingBar}
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        /**
         * 获取教师
         */
        ajaxRequest("sysAdminUserController/getPostListByDuty.do",{
            duty:3
        }, function (result) {
            var data=result.data;
            var arr=['<option value="">请选择</option>']; //<option value="0">请选择</option>
            for (var i = 0; i< data.length; i++) {
                arr.push('<option value="'+data[i].id+'">'+data[i].realName+'</option>')
            }
            $("#adminUserId").html(arr.join(''))
        },function(){
            ajaxError("加载员工信息失败");
        }, "post","json");

        /**
         * 获取教室
         */
        ajaxRequest("tssClassRoomController/getClassRoomList.do",null, function (result) {
            var data=result.data;
            var arr=['<option value="">请选择</option>']; //<option value="0">请选择</option>
            for (var i = 0; i< data.length; i++) {
                arr.push('<option value="'+data[i].id+'">'+data[i].name+'</option>')
            }
            $("#roomName").html(arr.join(''))
        },function(){
            ajaxError("加载教室信息失败");
        }, "post","json");

        /**
         * 获取课程体系
         */
        $(function(){
            ajaxRequest("sysCourseSystemController/courseSystemList.do",{
                type:1
            }, function (result) {
                var data=result.data;
                var arr=['<option value="">请选择</option>'];
                $.each(data,function(i,t){
                    arr.push('<option value="'+t.id+'">'+t.name+'</option>')
                })
                $("#courseSystemName").html(arr.join(''))
            },function(){
                ajaxError("加载课程体系失败");
            }, "get","json")
        });

        /**
         * 获取课程体系下课程名称
         */
        $("#courseSystemName").change(function(){
            var nowSelectedProvince=$(this).val();
            ajaxRequest("sysCourseSystemController/getChildrens.do", {
                pId: nowSelectedProvince,
            }, function (result) {
                var data=result.data;
                var arr=['<option value="">请选择</option>'];
                $.each(data,function(i,t){
                    arr.push('<option value="'+t.id+'">'+t.name+'</option>')
                })
                $(".courseId").html(arr.join(''))

            }, function () {
                ajaxError("加载课程名称失败")
            }, "get", "json")
        });

    });

    $(".selectpicker").select2();

//    $(function(){
//        var type = $("#type").val();
//        if(type == 2){
//            $('.interimBtn').css("background","#5db2ff");
//            $('.parentChildBtn').css("background","#fff");
//        }
//    });

    $(".parentChildBtn").click(function () {
        /*$(".packageType").val(1);
        $(".parentChild").removeClass("hidden").addClass("show");
        $(".interim").removeClass("show").addClass("hidden");
        $('.parentChildBtn').css("background","#5db2ff");
        $('.interimBtn').css("background","#fff");
        $(".modal-title").html("亲子会员课时统计");
        var type = $(".packageType").val();*/
        //ajaxPackageList(1)
        $("#type").val(2);
//        $('.interimBtn').css({"background":"#fff","color":"#4a647d"});
//        $('.parentChildBtn').css({"background":"#23a8f5","color":"#fff"});
        toView('tssClassesController/classAttendance.do',true,'POST',{pageSize:10})
    })
    $(".interimBtn").click(function () {
        /*$(".packageType").val(2);
        $(".interim").removeClass("hidden").addClass("show");
        $(".parentChild").removeClass("show").addClass("hidden");
        $('.interimBtn').css("background","#5db2ff");
        $('.parentChildBtn').css("background","#fff");
        $(".modal-title").html("过渡会员课时统计");
        var type = $(".packageType").val();*/
        //ajaxPackageList(2)
        $("#type").val(1);
        toView('tssClassesController/transitionClassAttendance.do',true,'POST',{pageSize:10})
//        setTimeout(function () {
//            $('.parentChildBtn').css({"background":"#fff","color":"#4a647d"});
//            $('.interimBtn').css({"background":"#23a8f5","color":"#fff"});
//        },100)
    })

//    操作考勤
    $("#tableScrollableClassAttendanceManagement").on("click",".classAttendanceTd",function () {
        var lessonsId = $(this).attr("lessonsId");
        var type = $("#type").val();
//        alert(type)
        var htmlTitle = "";
        if (type == 1) {
            htmlTitle = "班级考勤(亲子)"
        }
        if (type == 2) {
            htmlTitle = "班级考勤(过度)"
        }
        //ajaxRequest("tssAllocationController/toEditView.do",{
        ajaxRequest("tssMemberCheckAttendanceController/tssMemberCheckAttendanceClass.do", {
            lessonsId:lessonsId,
            type:type
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: htmlTitle,
                className: 'myDialog tssMemberCheckAttendanceDialog'
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")
    })
    /**
     * 批量考勤
     * @param that
     */
    function batchAttendance(that) {
        var type = $("#type").val();
        var htmlTitle = "";
        var ids = new Array();
        //var createTimes = new Array();
        var i = 0;
        //alert(type);
        $("input[name='id']:checked").each(function () {
            ids[i] = $(this).val();
            //createTimes[i] = $(this).attr("createTime");
            //arr.push($(this).val());
            i++;
        });
        if(ids.length > 0){
            messageValue = '您确定将选中的班级未考勤学生全部标为已出勤状态吗？';
            getTopWin().bootbox.dialog({
                title: '<i class="fa fa-lock red"></i>&nbsp;&nbsp;批量考勤',
                message: messageValue,
                closeButton: true,
                buttons: {
                    "确定": {
                        className: "btn-blue",
                        callback: function () {
                            ajaxRequest("tssMemberCheckAttendanceController/classBatchAttendance.do", {
                                ids: ids,
                                type:type
                            }, function () {
                                javascript:toView('tssClassesController/classAttendance.do',true,'POST',{pageSize:10})
                               /* bootbox.hideAll();
                                ajaxRequest("tssMemberCheckAttendanceController/tssMemberCheckAttendanceClass.do", {
                                    memberCheckAttendanceClassId: classId,
                                    memberCheckAttendanceCreateTime:createTime
                                }, function (html) {
                                    if (type == 1) {
                                        htmlTitle = "班级考勤(亲子)"
                                    }
                                    if (type == 2) {
                                        htmlTitle = "班级考勤(过渡)"
                                    }
                                    getTopWin(html).bootbox.dialog({
                                        message: html,
                                        title: htmlTitle,
                                        className: 'myDialog tssMemberCheckDialog'
                                    });
                                }, function () {
                                    ajaxError("加载页面失败!")
                                }, "get", "html")*/
                            }, function () {
                                ajaxError("加载页面失败!")
                            }, "get", "html")
                        }
                    },

                    "取消": {
                        className: "btn-blue",
                        callback: function () {
                            return false;
                        }
                    }
                }
            });
        }else{
            messageValue = '请选择需要批量考勤的会员，再点击此按钮。';
            getTopWin().bootbox.dialog({
                title: '<i class="fa fa-lock red"></i>&nbsp;&nbsp;批量考勤',
                message: messageValue,
                closeButton: true,
                buttons: {
                    "确定": {
                        className: "btn-blue",
                        callback: function () {
                            return false;
                        }
                    },
                    "取消": {
                        className: "btn-blue",
                        callback: function () {
                            return false;
                        }
                    }
                }
            });
        }
    }
    function Format(now,mask)
    {
        var d = now;
        var zeroize = function (value, length)
        {
            if (!length) length = 2;
            value = String(value);
            for (var i = 0, zeros = ''; i < (length - value.length); i++)
            {
                zeros += '0';
            }
            return zeros + value;
        };

        return mask.replace(/"[^"]*"|'[^']*'|\b(?:d{1,4}|m{1,4}|yy(?:yy)?|([hHMstT])\1?|[lLZ])\b/g, function ($0)
        {
            switch ($0)
            {
                case 'd': return d.getDate();
                case 'dd': return zeroize(d.getDate());
                case 'ddd': return ['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat'][d.getDay()];
                case 'dddd': return ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][d.getDay()];
                case 'M': return d.getMonth() + 1;
                case 'MM': return zeroize(d.getMonth() + 1);
                case 'MMM': return ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][d.getMonth()];
                case 'MMMM': return ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][d.getMonth()];
                case 'yy': return String(d.getFullYear()).substr(2);
                case 'yyyy': return d.getFullYear();
                case 'h': return d.getHours() % 12 || 12;
                case 'hh': return zeroize(d.getHours() % 12 || 12);
                case 'H': return d.getHours();
                case 'HH': return zeroize(d.getHours());
                case 'm': return d.getMinutes();
                case 'mm': return zeroize(d.getMinutes());
                case 's': return d.getSeconds();
                case 'ss': return zeroize(d.getSeconds());
                case 'l': return zeroize(d.getMilliseconds(), 3);
                case 'L': var m = d.getMilliseconds();
                    if (m > 99) m = Math.round(m / 10);
                    return zeroize(m);
                case 'tt': return d.getHours() < 12 ? 'am' : 'pm';
                case 'TT': return d.getHours() < 12 ? 'AM' : 'PM';
                case 'Z': return d.toUTCString().match(/[A-Z]+$/);
                // Return quoted strings with the surrounding quotes removed
                default: return $0.substr(1, $0.length - 2);
            }
        });
    };

    /**
     * 导出数据
     * @param formId 条件表单id
     * @param templateName 导出的文件名
     */
    function exportData(formId, templateName) {
        var typ = $("#type").val()
        /**
         * 定义标识
         * @param flag:代表有无条件参数
         * @Param t: 1代表亲子会员 2代表过渡会员
         * */
        var flag = 0;
        var ids = "";

        $("[name='id']:checked").each(function(){
            ids += "," +$(this).val();
        });
        ids = ids.substring(1);

        var params = $("#" + formId).serialize();
        var exportIframe = ' <iframe class="hidden" id="exportIframe" name="exportIframe"></iframe>';
        var exportSrc ="tssClassesController/classExportExcle.do";
        var $exportForm = $('<form method="post" target="exportIframe" action="' + exportSrc + '" id="exportForm"></form>');
        $("#" + formId).find("input").map(function (i, input) {
            var $input = $(input);
            var name = $input.attr("name");
            var val = $input.val();
            if (name) {
                $exportForm.append('<input type="hidden" name="' + name + '" value="' + val + '">');
            }
        });

        //追加参数
        $exportForm.append('<input type="hidden" name="ids" value="'+ids+'">');
        $exportForm.append('<input type="hidden" name="templateName" value="' + templateName + '">');
        $exportForm.append('<input type="hidden" name="loginAdminUserId" value="${loginUserId}">');

        var realName = $(".realName").val();
        var courseSystemName = $(".courseSystemName").val();
        var courseName = $(".courseName").val();
        var roomName = $(".roomName").val();
        var classAttendanceStatus = $(".classAttendanceStatus").val();
        if(realName != ""){alert(realName);
            $exportForm.append('<input type="hidden" name="realName" value='+realName+'>');
            flag = 1;
        }
        if(courseSystemName != ""){
            $exportForm.append('<input type="hidden" name="courseSystemName" value='+courseSystemName+'>');
            flag = 1;
        }
        if(roomName != ""){
            $exportForm.append('<input type="hidden" name="roomName" value='+roomName+'>');
            flag = 1;
        }
        if(classAttendanceStatus != ""){
            $exportForm.append('<input type="hidden" name="classAttendanceStatus" value='+classAttendanceStatus+'>');
            flag = 1;
        }

        $exportForm.append('<input type="hidden" name="flag" value='+flag+'>');
        $exportForm.append('<input type="hidden" name="typ" value='+typ+'>');

        //删除并提交表单
        $("body #exportIframe").remove();
        $("body #exportForm").remove();
        $("body").append(exportIframe);
        $("body").append($exportForm);
        $exportForm.submit();

    };


    //    隐藏显示搜索
    function iconsChange() {
        if($(".iconsChangeA").val()==1){
            $(".iconsChangeA").val("0");
            $(".iconsChangeA").css("background","url('assets/img/nav-img/icon_hidden.png')");
            $(".iconsChangeSpan").html("隐藏搜索栏");
            $(".search_Bar").removeClass("hidden");
        }else{
            $(".iconsChangeA").val("1");
            $(".iconsChangeA").css("background","url('assets/img/nav-img/icon_show.png')");
            $(".iconsChangeSpan").html("显示搜索栏");
            $(".search_Bar").addClass("hidden");
        }
    }

    //    筛选下拉框
    setTimeout(function () {
        var size = $(".search_Bar_item").size();
        if (size > 8) {
            $(".iconchange1").removeClass("hidden");
            $(".search_Bar_item").each(function () {
                var index = $(this).index();
                if (index <= 8) {
                    $(this).removeClass("hidden")
                }

            })
        } else {
            $(".iconchange1").addClass("hidden");
            $(".search_Bar_item").each(function () {
                $(this).removeClass("hidden")
            })
        }

        $(".iconDialogTd").each(function (tr,trItem) {
            var $tr = $(trItem);
            var sizeTd = $tr.find(".showDialogTd").size();
            if(sizeTd>5){
                $tr.find(".iconchangeTd").removeClass("hidden");
                $tr.find(".showDialogTd").each(function (a,aItem) {
                    var $a = $(aItem);
                    if(($a.index()+1)>5){
                        var html = $a.get(0);
                        $a.remove();
                        $tr.find(".popover-content").get(0).append(html);
                        $a.addClass("appendTdA")

                    }
                })

            }else{
                $tr.find(".iconchangeTd").addClass("hidden");
                $tr.find(".showDialogTd").each(function () {
                    $tr.removeClass("hidden");
                })
            }
        })

    }, 10);

    function iconchangeShow(that) {

        if($(that).attr("value")==1){
            $(that).attr("value","0");
            $(".iconchange1 .fa").removeClass("fa-chevron-down").addClass("fa-chevron-up");
            $(".search_Bar_item").each(function () {
                $(this).removeClass("hidden")
            })
        }else{
            $(that).attr("value","1");
            $(".iconchange1 .fa").removeClass("fa-chevron-up").addClass("fa-chevron-down");
            $(".search_Bar_item").each(function () {
                var index = $(this).index();
                if (index <= 8) {
                    $(this).removeClass("hidden")
                }else{
                    $(this).addClass("hidden")
                }

            })
        }

    }

</script>